<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <link rel="stylesheet" href="${request.contextPath}/statics/css/wsDangan.css">
    <link rel="stylesheet" href="${request.contextPath}/statics/css/bootstrap.css">

    <!-- 引入组件库 -->
    <script src="${request.contextPath}/statics/vue/vue.js"></script>
    <script src="${request.contextPath}/statics/vue/index.js"></script>
    <script src="${request.contextPath}/statics/vue/axios.js"></script>
    <link rel="stylesheet" href="${request.contextPath}/statics/vue/index.css">
    <script src="${request.contextPath}/statics/js/bootstrap.js"></script>
    <script src="${request.contextPath}/statics/js/jquery1.9.1.js"></script>
    <script src="${request.contextPath}/statics/js/config.js"></script>
    <script type="text/javascript" src="${request.contextPath}/statics/js/jqprint/jquery.jqprint-0.3.js"></script>
    <script type="text/javascript" src="${request.contextPath}/statics/js/jqprint/jquery-migrate.js"></script>
    <script type="text/javascript" src="${request.contextPath}/statics/js/table2Excel/jquery.base64.js"></script>
    <script type="text/javascript" src="${request.contextPath}/statics/js/table2Excel/tableExport.js"></script>
    <script src="${request.contextPath}/statics/js/url-search-params.js"></script>

    <title>文书档案管理</title>
</head>
<body class="body" style="background-color:#F1F1F1;">
<div id="app" class="container app" v-cloak style="width: 100%;height: 100%;padding: 0px;">

    <#include "danganHeader.html">
    <el-row class="search-container" style="padding: 0px">
        <div style="width: 15%;display: block;height: 777px;float: left;background-color: #f7f8fa;">
            <el-menu :default-openeds="['1', '2']"
                     default-active="1-1">
                <el-submenu index="1">
                    <template slot="title"><i class="el-icon-message"></i>文书档案</template>
                    <el-menu-item-group>
                        <el-menu-item @click="wsGd=true,wsEdit=false,ywEdit=false,ywAdd=false" index="1-1">文书归档</el-menu-item>
                        <el-menu-item @click="wsGd=false,wsEdit=true,ywEdit=false,ywAdd=false" index="1-2">档案整理</el-menu-item>
                    </el-menu-item-group>
                </el-submenu>
                <el-submenu index="2">
                    <template slot="title"><i class="el-icon-s-cooperation"></i>业务档案</template>
                    <el-menu-item-group>
                        <el-menu-item  @click="wsGd=false,wsEdit=false,ywEdit=false,ywAdd=true" index="2-1">业务归档</el-menu-item>
                        <el-menu-item  @click="wsGd=false,wsEdit=false,ywEdit=true,ywAdd=false" index="2-2">档案整理</el-menu-item>
                    </el-menu-item-group>
                </el-submenu>
            </el-menu>
        </div>
        <!--文书归档-->
        <div v-show="wsGd"
             style="margin-left: 15%;width: 85%;height: 777px;background-color:#F1F1F1;box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1)">
            <el-row>
                <el-col :span="14"
                        style="margin-left: 16%;margin-top:20px;background: #ffffff;min-height: 400px;padding:20px 55px 0px 55px ;">

                    <el-form ref="form" :model="gdForm" label-width="120px">
                        <el-form-item label="收文号：">
                            <el-input v-model="gdForm.swh" clearable style="width:360px"></el-input>
                            <el-button type="primary" @click="searchOaWs" style="margin-left: 10px;">搜索</el-button>
                        </el-form-item>
                        <el-form-item label="影像文件：">

                            <el-input v-model="upload.filePath" style="width:360px;float: left;"></el-input>
                            <el-button v-show="gdForm.upLoadType==1"
                                       style="float: left;margin-left: 13px;"
                                       type="primary" @click="loadPdf(0,3)">查看
                            </el-button>
                            <el-upload
                                    v-show="gdForm.upLoadType==2"
                                    class="upload-demo"
                                    :action="upload.url"
                                    multiple=false
                                    show-file-list=false
                                    :data="upload.params"
                                    :on-success="uploadSuccess"
                                    style="float: left;">
                                <el-button style="margin-left: 13px;" type="primary">上传</el-button>
                            </el-upload>
                            <el-radio-group style="margin-left: 20px;" v-model="gdForm.upLoadType">
                                <el-radio :label="1">ftp</el-radio>
                                <el-radio :label="2">本地</el-radio>
                            </el-radio-group>
                        </el-form-item>

                        <el-row :gutter="20">
                            <el-col :span="12">
                                <el-form-item label="文件权限：">
                                    <el-select v-model="gdForm.jnmlqx" placeholder="请选择文件权限">
                                        <el-option label="外部一般" value="1">外部一般</el-option>
                                        <el-option label="内部一般" value="2">内部一般</el-option>
                                        <el-option label="内部机密" value="3">内部机密</el-option>
                                        <el-option label="外部机密" value="4">外部机密</el-option>
                                        <el-option label="绝密" value="5">绝密</el-option>
                                    </el-select>

                                </el-form-item>
                            </el-col>
                            <el-col :span="12">
                                <el-form-item label="案卷权限：">
                                    <el-select v-model="gdForm.inmlqx" placeholder="请选择文件权限">
                                        <el-option label="外部一般" value="1">外部一般</el-option>
                                        <el-option label="内部一般" value="2">内部一般</el-option>
                                        <el-option label="内部机密" value="3">内部机密</el-option>
                                        <el-option label="外部机密" value="4">外部机密</el-option>
                                        <el-option label="绝密" value="5">绝密</el-option>
                                    </el-select>
                                </el-form-item>
                            </el-col>
                        </el-row>

                        <el-row :gutter="20">
                            <el-col :span="12">
                                <el-form-item label="分类号：">
                                    <el-input disabled="true" v-model="gdForm.flh"></el-input>
                                </el-form-item>
                            </el-col>
                            <el-col :span="12">
                                <el-form-item label="全宗号：">
                                    <el-input v-model="gdForm.qzh"></el-input>
                                </el-form-item>
                            </el-col>
                        </el-row>
                        <el-row :gutter="20">
                            <el-col :span="12">
                                <el-form-item label="件号：">
                                    <el-input v-model="gdForm.js"></el-input>
                                </el-form-item>
                            </el-col>
                            <el-col :span="12">
                                <el-form-item label="页数：">
                                    <el-input v-model="gdForm.ys"></el-input>
                                </el-form-item>
                            </el-col>
                        </el-row>
                        <el-row :gutter="20">
                            <el-col :span="12">
                                <el-form-item label="*年度：">
                                    <el-input @change="getJs" type="number" v-model="gdForm.nd"></el-input>
                                </el-form-item>
                            </el-col>
                            <el-col :span="12">
                                <el-form-item label="保管期限：">
                                    <el-select @change="getJs" v-model="gdForm.bgqx" placeholder="">
                                        <el-option label="10年" value="10年">10年</el-option>
                                        <el-option label="30年" value="30年">30年</el-option>
                                        <el-option label="长期" value="长期">长期</el-option>
                                        <el-option label="短期" value="短期">短期</el-option>
                                        <el-option label="永久" value="永久">永久</el-option>
                                    </el-select>
                                </el-form-item>
                            </el-col>
                        </el-row>
                        <el-row :gutter="20">
                            <el-col :span="12">
                                <el-form-item label="责任人：">
                                    <el-input v-model="gdForm.zrr" clearable></el-input>
                                </el-form-item>
                            </el-col>
                            <el-col :span="12">
                                <el-form-item label="*文号：">
                                    <el-input v-model="gdForm.wh" clearable></el-input>
                                </el-form-item>
                            </el-col>
                        </el-row>
                        <el-form-item label="*文件标题：">
                            <el-input type="textarea" v-model="gdForm.bt" clearable></el-input>
                        </el-form-item>
                        <el-row :gutter="20">
                            <el-col :span="12">
                                <el-form-item label="日期：">
                                    <el-date-picker
                                            v-model="gdForm.rq"
                                            type="date"
                                            value-format="yyyy-MM-dd"
                                            placeholder="选择日期">
                                    </el-date-picker>
                                </el-form-item>
                            </el-col>
                            <el-col :span="12">
                                <el-form-item label="状态：">
                                    <el-tag :type="gdForm.wsDanganStatus">{{gdForm.isGD?'已归档':'未归档'}}</el-tag>
                                </el-form-item>
                            </el-col>
                        </el-row>

                        <el-form-item>
                            <el-button type="primary" @click="guiDang">归档</el-button>
                        </el-form-item>
                    </el-form>

                </el-col>
            </el-row>
        </div>
        <!--文书编辑，导出excel-->
        <div v-show="wsEdit"
             style="margin-left: 15%;width: 85%;height: 777px;padding:10px 30px 30px 30px ;box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1)">
            <el-form ref="form" :inline="true" size="small" :model="form" label-width="40px">
                <el-form-item label="件号">
                    <el-input v-model="form.js" type="number"></el-input>
                </el-form-item>
                <el-form-item label="保管期限" label-width="60px;">
                    <el-select v-model="form.bgqx" style="width: 100px;" placeholder="不限">
                        <el-option label="不限" value=""></el-option>
                        <el-option v-for="bgqx in bgqxOptions" :label="bgqx.code" :value="bgqx.value"></el-option>

                    </el-select>
                </el-form-item>
                <el-form-item label="年度">
                    <el-select v-model="form.nd" style="width: 100px;" placeholder="不限">
                        <el-option label="不限" value=""></el-option>
                        <el-option v-for="year in years" :label="year" :value="year"></el-option>

                    </el-select>
                </el-form-item>
                <el-form-item label="文号">
                    <el-input v-model="form.wh"></el-input>
                </el-form-item>
                <el-form-item label="文件标题" label-width="60px;">
                    <el-input v-model="form.bt" style="width: 250px;"></el-input>
                </el-form-item>
                <el-form-item>
                    <el-button type="primary" @click="search">查询</el-button>
                </el-form-item>
            </el-form>
            <div style="height: 40px;display: block;padding-bottom: 15px;">
                <el-row>
                    <el-col :span="16">
                        <el-pagination
                                style="margin-bottom: 10px;"
                                background
                                :page-sizes="[10,200, 500, 1000]"
                                :page-size="10"
                                layout="prev, pager, next,total,sizes"
                                @current-change="danganPageChange"
                                @size-change="danganPageSizeChange"
                                @prev-click="danganPageChange"
                                @next-click="danganPageChange"
                                :current-page="page.currPage"
                                prev-text="上一页"
                                next-text="下一页"
                                :total="page.totalCount">
                        </el-pagination>
                    </el-col>
                    <el-col :span="8">
                        <el-button type="primary" @click="exportExcel" size="mini">导出excel</el-button>
                        <el-button type="primary" @click="printTable" size="mini">打印</el-button>
                    </el-col>
                </el-row>


            </div>
            <el-row>
                <el-table
                        :data="tableData"
                        stripe
                        border
                        size="mini"
                        max-height="640"
                        @selection-change="handleSelectionChange"
                        style="width: 100%;height: 640px;box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1)"
                        id="wsTable"
                >
                    <el-table-column
                            label="打印"
                            type="selection"
                            width="55">
                    </el-table-column>
                    <el-table-column
                            prop="xh"
                            label="序号"
                            width="180">
                    </el-table-column>
                    <el-table-column
                            align="left"
                            prop="bt"
                            label="文件标题"
                            width="180">
                    </el-table-column>
                    <el-table-column
                            prop="bgqx"
                            label="保管期限">
                    </el-table-column>
                    <el-table-column
                            prop="wh"
                            align="left"
                            label="文号">
                    </el-table-column>
                    <el-table-column
                            prop="nd"
                            label="年度">
                    </el-table-column>
                    <el-table-column
                            prop="js"
                            label="件号">
                    </el-table-column>
                    <el-table-column
                            align="left"
                            label="操作">
                        <template slot-scope="scope">
                            <el-button @click="editWsDangan(scope.row)" type="primary" size="small">编辑</el-button>
                            <el-button @click="deleteWsFile(scope.row,scope.$index)" type="danger" size="small">删除</el-button>
                        </template>
                    </el-table-column>
                </el-table>
            </el-row>
        </div>
        <!--业务档案编辑，-->
        <div v-show="ywEdit"
             style="margin-left: 15%;width: 85%;height: 777px;padding:10px 30px 30px 30px ;box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1)">
            <el-form ref="ywForm" :inline="true"
                     label-position="left"
                     style="width:80%;"
                     size="small" :model="form" label-width="120px">
                <el-form-item  class="mb_5" label="土地使用者" label-width="90px">
                    <el-input v-model="ywForm.landuser" clearable></el-input>
                </el-form-item>
                <el-form-item label="土地坐落">
                    <el-input v-model="ywForm.position" clearable></el-input>
                </el-form-item>
                <el-form-item v-show="ywForm.flh!='E'"  label="土地证号">
                    <el-input v-model="ywForm.c.zh" clearable></el-input>
                </el-form-item>
                <el-form-item v-show="ywForm.flh!='E'" label="图号" label-width="50px;">
                    <el-input v-model="ywForm.c.th" clearable></el-input>
                </el-form-item>
                <el-form-item v-show="ywForm.flh!='E'" label="地号" label-width="50px;">
                    <el-input v-model="ywForm.c.dh" clearable></el-input>
                </el-form-item>
                <el-form-item v-show="ywForm.flh=='E'" label="批准文号">
                    <el-input v-model="ywForm.e.pzwh" clearable></el-input>
                </el-form-item>
                <el-form-item v-show="ywForm.flh=='E'" label="项目名称" label-width="50px;">
                    <el-input v-model="ywForm.e.bt" clearable></el-input>
                </el-form-item>
                <el-form-item label="案卷号" label-width="50px;">
                    <el-input v-model="ywForm.ajh" clearable></el-input>
                </el-form-item>
                <el-form-item label="所在地" label-width="60px;">
                    <el-select v-model="ywForm.szd" style="width: 100px;" placeholder="不限">
                        <el-option label="不限" value=""></el-option>
                        <el-option v-for="szd in options.szdOptions" :key="szd.location" :label="szd.location"
                                   :value="szd.location"></el-option>
                    </el-select>
                </el-form-item>
                <el-form-item v-if="ywForm.flh=='C'" label="" label-width="1px;">
                    <el-select v-model="ywForm.sFlh" style="width: 100px;" placeholder="不限">
                        <el-option label="默认全部" value="C"></el-option>
                        <el-option v-for="cFlh in options.cFlhOptions" :key="cFlh.flh" :label="cFlh.flh"
                                   :value="cFlh.value"></el-option>
                    </el-select>
                </el-form-item>
                <el-form-item  v-if="ywForm.flh=='E'" label="" label-width="1px;">
                    <el-select v-model="ywForm.sFlh" style="width: 100px;" placeholder="不限">
                        <el-option label="默认全部" value="E"></el-option>
                        <el-option v-for="eFlh in options.eFlhOptions" :key="eFlh.flh" :label="eFlh.flh"
                                   :value="eFlh.value"></el-option>
                    </el-select>
                </el-form-item>
                <el-form-item  label="分类号" label-width="1px;">
                    <el-select v-model="ywForm.flh" style="width: 100px;"
                               @change="flhChange"
                               placeholder="不限">
                        <el-option v-for="flh in options.flhOptions" :key="flh.flh" :label="flh.flh"
                                   :value="flh.value"></el-option>
                    </el-select>
                </el-form-item>
                <el-form-item>
                    <el-button type="primary" @click="ywSearch">查询</el-button>
<!--                    <el-button  @click="addYwDanganDialogVisible = true">新增档案</el-button>-->

                </el-form-item>
            </el-form>
            <div style="height: 40px;display: block;padding-bottom: 15px;">
                <el-pagination
                        style="margin-bottom: 10px;"
                        background
                        layout="prev, pager, next,total"
                        @current-change="ywDanganPageChange"
                        @prev-click="ywDanganPageChange"
                        @next-click="ywDanganPageChange"
                        :current-page="ywPage.currPage"
                        prev-text="上一页"
                        next-text="下一页"
                        :total="ywPage.totalCount">
                </el-pagination>
            </div>
            <el-row>
                <el-table
                        :data="ywTableData"
                        stripe
                        border
                        size="mini"
                        style="width: 100%;height: 600px;box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);"
                >
                    <el-table-column
                            prop="xh"
                            align="center"
                            header-align="center"
                            label="序号"
                            width="120">
                    </el-table-column>
                    <el-table-column
                            align="left"
                            v-if="eColumn==false"
                            prop="zh"
                            label="土地证号"
                            width="190">
                    </el-table-column>
                    <el-table-column
                            v-if="eColumn"
                            align="left"
                            header-align="center"
                            prop="pzwh"
                            label="批准文号"
                            width="150">
                    </el-table-column>
                    <el-table-column
                            align="left"
                            header-align="center"
                            prop="landuser"
                            width="240"
                            :label="ywForm.flh=='E'?'用地单位':'土地使用者'">
                    </el-table-column>
                    <el-table-column
                            v-if="eColumn"
                            align="left"
                            header-align="center"
                            prop="position"
                            width="200"
                            label="土地坐落">
                    </el-table-column>
                    <el-table-column
                            v-if="eColumn"
                            align="left"
                            header-align="center"
                            prop="bt"
                            label="项目名称">
                    </el-table-column>
                    <el-table-column
                            align="center"
                            header-align="center"
                            prop="ajh"
                            width="100"
                            label="案卷号">
                    </el-table-column>
                    <el-table-column
                            align="center"
                            header-align="center"
                            prop="szd"
                            width="80"
                            label="所在地">
                    </el-table-column>
                    <el-table-column
                            v-if="ywForm.flh!='D'"
                            align="left"
                            header-align="center"
                            width="80"
                            label="定位状态">
                        <template slot-scope="scope">
                            <el-tag v-if="ywForm.flh=='C' "  type="scope.row.zdbsm ? success : danger" size="small">
                                {{scope.row.zdbsm ? '已定位' : '未定位'}}
                            </el-tag>
                            <el-tag v-else  type="scope.row.xmguid ? success : danger" size="small">
                                {{scope.row.xmguid ? '已定位' : '未定位'}}
                            </el-tag>
                        </template>
                    </el-table-column>
                    <el-table-column
                            align="left"
                            header-align="center"
                            width="250"
                            label="操作">
                        <template slot-scope="scope">
                            <el-button type="default" size="small" @click="bindJsydVisibleClick(scope.row)" >定位绑定</el-button>
                            <el-button @click="showYwPdf(scope.row)" type="primary" size="small">查看</el-button>
                            <el-button @click="deleteYwDangan(scope.row,scope.$index)" type="danger" size="small">删除</el-button>
                        </template>
                    </el-table-column>
                </el-table>
            </el-row>
        </div>
        <div v-show="ywAdd" style="margin-left: 15%;width: 85%;height: 777px;padding:10px 30px 30px 30px ;box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1)">
            <el-row>
                <el-col :span="20"
                        style="margin-left: 8%;margin-top:20px;background: #ffffff;min-height: 400px;padding:20px 55px 0px 55px ;">
                    <el-form ref="form" :model="ywDanganForm" label-width="120px">
                        <el-row>
                            <el-col :span="10">

                                <el-form-item label="土地使用者">
                                    <el-input v-model="ywDanganForm.landuser"></el-input>
                                </el-form-item>
                                <el-form-item label="分类号">
<!--                                    <el-select v-model="ywDanganForm.flh" >-->
<!--                                        <el-option v-for="flh in options.flhOptions" :key="flh.flh" :label="flh.flh"-->
<!--                                                   :value="flh.value"></el-option>-->
<!--                                    </el-select>-->
                                    <el-cascader :options="options.flhDetailOptions"
                                                 :props="cascaderProps"
                                                 :show-all-levels="false"
                                                 @change="selectYwDanganFlhChange"
                                    >
                                    </el-cascader>
                                </el-form-item>
                                <el-form-item label="土地证号">
                                    <el-input v-model="ywDanganForm.zh"></el-input>
                                </el-form-item>
                                <el-form-item label="批准文号">
                                    <el-input v-model="ywDanganForm.pzwh"></el-input>
                                </el-form-item>
                                <el-form-item label="土地坐落">
                                    <el-input v-model="ywDanganForm.position"></el-input>
                                </el-form-item>
                                <el-form-item label="土地用途">
                                    <el-input v-model="ywDanganForm.tdyt"></el-input>
                                </el-form-item>
                                <el-form-item label="地类">
                                    <el-input v-model="ywDanganForm.dl"></el-input>
                                </el-form-item>
                                <el-form-item label="土地等级">
                                    <el-select  v-model="ywDanganForm.tddj" placeholder="">
                                        <el-option label="一级" value="一级">一级</el-option>
                                        <el-option label="二级" value="二级">二级</el-option>
                                        <el-option label="三级" value="三级">三级</el-option>
                                        <el-option label="四级" value="四级">四级</el-option>
                                        <el-option label="五级" value="五级">五级</el-option>
                                    </el-select>
                                </el-form-item>
                                <el-form-item label="件数">
                                    <el-input type="number" v-model="ywDanganForm.js"></el-input>
                                </el-form-item>
                            </el-col>
                            <el-col :span="10">
                                <el-form-item label="地号">
                                    <el-input v-model="ywDanganForm.dh"></el-input>
                                </el-form-item>
                                <el-form-item label="图号">
                                    <el-input v-model="ywDanganForm.th"></el-input>
                                </el-form-item>
                                <el-form-item label="权属性质">
                                    <el-input v-model="ywDanganForm.qsxz"></el-input>
                                </el-form-item>
                                <el-form-item label="全宗号">
                                    <el-input v-model="ywDanganForm.qzh"></el-input>
                                </el-form-item>
                                <el-form-item label="案卷号">
                                    <el-input v-model="ywDanganForm.ajh"></el-input>
                                </el-form-item>
                                <el-form-item label="年度">
                                    <el-date-picker
                                            v-model="ywDanganForm.nd"
                                            type="year"
                                            value-format="yyyy"
                                            placeholder="选择年">
                                    </el-date-picker>
                                </el-form-item>
                                <el-form-item label="土地面积">
                                    <el-input v-model="ywDanganForm.tdmj"></el-input>
                                </el-form-item>
                                <el-form-item label="页数">
                                    <el-input type="number" v-model="ywDanganForm.ys"></el-input>
                                </el-form-item>
                                <el-form-item label="保管期限：">
                                    <el-select  v-model="ywDanganForm.bgqx" placeholder="">
                                        <el-option label="10年" value="10年">10年</el-option>
                                        <el-option label="30年" value="30年">30年</el-option>
                                        <el-option label="长期" value="长期">长期</el-option>
                                        <el-option label="短期" value="短期">短期</el-option>
                                        <el-option label="永久" value="永久">永久</el-option>
                                    </el-select>
                                </el-form-item>

                            </el-col>
                        </el-row>



                        <el-form-item>
                            <el-button type="primary" @click="addYwDangan">添  加</el-button>
                        </el-form-item>
                    </el-form>
                </el-col>

            </el-row>
        </div>
    </el-row>
    <table id="exportTable" class="table table-striped table-bordered" hidden="hidden" >
        <thead>
            <tr>
                <th class="col-xs-1" style="width:5%"> 序号</th>
                <th class="col-xs-2" style="width:10%">档号</th>
                <th class="col-xs-2"style="width:15%">文号</th>
                <th class="col-xs-2" style="width:8%">责任人</th>
                <th class="col-xs-3" style="width:32%">题名</th>
                <th class="col-xs-1" style="width:15%"> 日期</th>
                <th class="col-xs-1" style="width:5%">密级</th>
                <th class="col-xs-1" style="width:5%">页数</th>
                <th class="col-xs-1" style="width:5%">备注</th>
            </tr>
        </thead>
        <tbody>
            <tr v-for=" ws in multipleSelection" >
                <td>{{ws.js}}</td>
                <td>{{"0478-WS·"+ws.nd+"-"+ws.dhbgqx+"-BGS-"+ws.bcjs}}</td>
                <td>{{ws.wh}}</td>
                <td>市国土局</td>
                <td>{{ws.bt}}</td>
                <td>{{ws.fmtrq}}</td>
                <td> </td>
                <td>{{ws.ys}}</td>
                <td></td>
            </tr>
        </tbody>
    </table>
    <el-dialog :visible.sync="pdfDialogVisible"
               modal-append-to-body="false"
               fullscreen=true
               center
               modal=false
    >
        <div style="height: 741px;">
            <iframe contextmenu="return false;" scrolling="yes" style="width:100%;height:100%;"
                    :src="pdfUrl">
            </iframe>
        </div>
        <span slot="footer" class="dialog-footer">
            <el-button type="primary" @click="pdfDialogVisible=false">返  回</el-button>
          </span>
    </el-dialog>
    <el-dialog :visible.sync="editWsDialogVisible"
               modal-append-to-body="false"
               fullscreen=true
               center
               modal=false
               top="142px">
        <el-row style="height:740px;">
            <el-col :span="15" style="height: 100%;">
                <div style="height: 100%;width: 100%;float: left">
                    <iframe id="editPdfIframe" contextmenu="return false;" scrolling="yes" style="width:97%;height:100%;"
                            :src="pdfUrl">
                    </iframe>
                </div>
            </el-col>
            <el-col :span="8" style="height:100%">
                <div class="row modle_nomh " style="padding-left: 20px;background: #DEDEDE">
                    <h5>文件信息</h5>
                </div>
                <div class="row modle_nomh  " style="margin-top: 10px;padding: 15px 30px 0px 0px;">
                    <el-form ref="form" :model="dangan" size="small" label-width="120px">
                        <el-form-item label="分类号：">
                            <el-input v-model="dangan.flh" style="width:360px"></el-input>
                        </el-form-item>
                        <el-form-item label="件号：">
                            <el-input v-model="dangan.js" style="width:360px"></el-input>
                        </el-form-item>
                        <el-form-item label="年度：">
                            <el-input type="number" v-model="dangan.nd" style="width:360px"></el-input>
                        </el-form-item>
                        <el-form-item label="责任人：">
                            <el-input v-model="dangan.zrr" style="width:360px"></el-input>
                        </el-form-item>
                        <el-form-item label="保管期限：">
                            <el-select v-model="dangan.bgqx" placeholder="">
                                <el-option label="10年" value="10年">10年</el-option>
                                <el-option label="30年" value="30年">30年</el-option>
                                <el-option label="长期" value="长期">长期</el-option>
                                <el-option label="短期" value="短期">短期</el-option>
                                <el-option label="永久" value="永久">永久</el-option>
                            </el-select>
                        </el-form-item>
                        <el-form-item label="文号：">
                            <el-input v-model="dangan.wh" style="width:360px"></el-input>
                        </el-form-item>
                        <el-form-item label="文件标题：">
                            <el-input type="textarea" v-model="dangan.bt"></el-input>
                        </el-form-item>
                        <el-form-item label="日期：">
                            <el-date-picker
                                    v-model="dangan.rq"
                                    type="date"
                                    placeholder="选择日期">
                            </el-date-picker>
                        </el-form-item>
                        <el-form-item label="全宗号：">
                            <el-input v-model="dangan.qzh"></el-input>
                        </el-form-item>
                        <el-form-item label="案卷权限：">
                            <el-select v-model="dangan.mlqx" placeholder="请选择文件权限">
                                <el-option label="外部一般" value="1">外部一般</el-option>
                                <el-option label="内部一般" value="2">内部一般</el-option>
                                <el-option label="内部机密" value="3">内部机密</el-option>
                                <el-option label="外部机密" value="4">外部机密</el-option>
                                <el-option label="绝密" value="5">绝密</el-option>
                            </el-select>
                        </el-form-item>
                        <el-form-item label="上传路径：">
                            <el-input v-model="dangan.filePath" style="width:360px;float: left;"></el-input>
                            <el-upload
                                    class="upload-demo"
                                    :action="upload.url"
                                    multiple=false
                                    show-file-list=false
                                    :data="upload.params"
                                    :on-success="uploadSuccess"
                                    style="float: left;">
                                <el-button style="margin-left: 13px;" type="primary">上传</el-button>
                            </el-upload>
                        </el-form-item>
                        <el-form-item>
                            <el-button type="primary" @click="saveWsDangan">保存</el-button>
                        </el-form-item>
                    </el-form>
                </div>
            </el-col>
            <el-col :span="1"></el-col>
        </el-row>
        <span slot="footer" class="dialog-footer">
            <el-button type="primary" @click="editWsDialogVisible = false">返  回</el-button>
          </span>
    </el-dialog>

    <el-dialog
            :visible.sync="ywPdfDialogVisible"
            fullscreen=true
            width="100%"
            height="100%"
            title="档案详情"
            center
    >
        <el-row style="height:100%;">
            <el-col :span="6" style="height: 100%;">
                <div class="pdf-menu-title"
                     style="line-height:1.7 ;height:5%;margin-left:0px;font-size:18px;font-weight: bold;text-indent: 20px;">
                    档案卷内目录

                </div>
                <div class="" style="height: 43%;width: 100%;overflow-y: scroll;overflow-x: scroll;">
                    <div class="row" style="min-height:100%;padding: 0px;margin: 0px;padding-top:10px;">

                        <div id="" v-for="(jnml,index) in daJnmlData" @click="loadYwPdf(jnml.jnmlbh)"
                             class="pdf-menu " :class="{ 'active' : activeJnmlbh==jnml.jnmlbh }"
                             style="padding-left: 50px;padding-right:10px;">
                            <el-row>
                                <el-col :span="14">
                                    {{jnml.mlmc}}
                                </el-col>
                                <el-col :span="10">
                                    <el-button style="float: right;margin-left: 3px;" size="mini" @click.stop="editYwJnmlDialog(jnml)" >编辑</el-button>
                                    <el-button style="float: right;margin-left: 0px" size="mini" @click.stop="deleteYwJnmlDialog(jnml,index)" type="danger" >删除</el-button>
                                </el-col>
                            </el-row>
                        </div>
                        <div class="pdf-menu "
                             style="padding-left: 50px;">
                            <el-button style="margin-left:30% " @click.stop="addYwJnml(dangan.nbxh)" size="mini" >添 加</el-button>
                        </div>
                    </div>
                </div>
                <div class="border" style="height: 2%;width: 100%"></div>
                <div class="row pdf-menu-title"
                     style="line-height:1.7 ;height:5%;margin-left:0px;font-size:18px;font-weight: bold;text-indent: 20px;">
                    档案基本信息
                    <el-button style="margin-left:50% " size="mini" @click="saveYwDangan" >保存</el-button>
                </div>
                <div class="" style="height: 43%;width: 100% ;overflow-y: scroll;">
                    <el-form ref="form" :model="dangan" size="small" label-width="120px">
                        <el-form-item label="用地单位：">
                            <el-input v-model="dangan.landuser" style="width:280px"></el-input>
                        </el-form-item>
                        <el-form-item label="土地坐落：">
                            <el-input v-model="dangan.position" style="width:280px"></el-input>
                        </el-form-item>
                        <el-form-item label=" 证 号：">
                            <el-input v-model="dangan.zh" style="width:280px"></el-input>
                        </el-form-item>
                        <el-form-item label=" 批准文号：">
                            <el-input v-model="dangan.pzwh" style="width:280px"></el-input>
                        </el-form-item>
                        <el-form-item label=" 图号：">
                            <el-input v-model="dangan.th" style="width:280px"></el-input>
                        </el-form-item>
                        <el-form-item label=" 地类：">
                            <el-input v-model="dangan.dl" style="width:280px"></el-input>
                        </el-form-item>
                        <el-form-item label=" 土地等级：">
                            <el-input v-model="dangan.tddj" style="width:280px"></el-input>
                        </el-form-item>
                        <el-form-item label=" 权属性质：">
                            <el-input v-model="dangan.qsxz" style="width:280px"></el-input>
                        </el-form-item>
                        <el-form-item label=" 发证日期：">
                            <el-input v-model="dangan.fzrq" style="width:280px"></el-input>
                        </el-form-item>
                        <el-row>
                            <el-col :span="10">
                                <el-form-item label=" 件 号：">
                                    <el-input v-model="dangan.js" style="width:100px"></el-input>
                                </el-form-item>
                            </el-col>
                            <el-col :span="10">
                                <el-form-item label=" 页 数：">
                                    <el-input v-model="dangan.js" style="width:100px"></el-input>
                                </el-form-item>
                            </el-col>
                        </el-row>
                        <el-row>
                            <el-col :span="10">
                                <el-form-item label=" 全宗号：">
                                    <el-input v-model="dangan.qzh" style="width:100px"></el-input>
                                </el-form-item>
                            </el-col>
                            <el-col :span="10">
                                <el-form-item label=" 目录号：">
                                    <el-input v-model="dangan.mlh" style="width:100px"></el-input>
                                </el-form-item>
                            </el-col>
                        </el-row>
                        <el-row>
                            <el-col :span="10">
                                <el-form-item label=" 分类号：">
                                    <el-input v-model="dangan.flh" style="width:100px"></el-input>
                                </el-form-item>
                            </el-col>
                            <el-col :span="10">
                                <el-form-item label=" 案卷号：">
                                    <el-input v-model="dangan.ajh" style="width:100px"></el-input>
                                </el-form-item>
                            </el-col>
                        </el-row>
                    </el-form>
                </div>
            </el-col>
            <el-col :span="18" style="height:100%">
                <div id="hideLeft" @click="hidePdfLeftInfo" class="hand" style="height: 100%;
                float: left;cursor: pointer;width: 2%;">
                    <div style="height: 48%;">
                        <span class="el-icon-arrow-left" style="top:48%;font-size:25px;
                        position: absolute;
                        padding-left: 3px;"></span>
                    </div>
                </div>
                <div style="height: 100%;width: 98%;float: left">
                    <iframe id="ywPdfIframe" contextmenu="return false;" scrolling="yes" style="width:100%;height:100%;"
                            :src="ywPdfUrl">
                    </iframe>
                </div>
            </el-col>
        </el-row>

        <span slot="footer" class="dialog-footer">
            <el-button type="primary" @click="ywPdfDialogVisible = false">返回</el-button>
          </span>
    </el-dialog>
    <el-dialog
            title="卷目录编辑"
            center
            :visible.sync="jnmlDialogVisible"
            width="30%">
        <el-form >
            <el-form-item label="卷内目录名称" :label-width="100">
                <el-input v-model="editJnml.mlmc" autocomplete="off"></el-input>
            </el-form-item>
            <el-form-item label="上传文件路径" :label-width="100">
                <el-input v-model="dangan.filePath" style="width:300px;float: left;"></el-input>
                <el-upload
                        ref="jnmlFileUpload"
                        class="upload-demo"
                        :action="upload.url"
                        multiple=false
                        :show-file-list="false"
                        :data="upload.params"
                        :on-success="ywJnmlFileUploadSuccess"
                        style="float: right;margin-left: 3px;">
                    <el-button size="mini"  type="primary">上传</el-button>
                </el-upload>
            </el-form-item>
        </el-form>
        <span slot="footer" class="dialog-footer">
    <el-button @click="jnmlDialogVisible = false">取 消</el-button>
    <el-button type="primary" @click="editYwJnml">确 定</el-button>
  </span>
    </el-dialog>
    <el-dialog
            title="新增业务档案"
            center
            :visible.sync="addYwDanganDialogVisible"
            width="40%"
        >
        <el-form ref="form" :model="ywDanganForm" label-width="120px">
            <el-form-item label="土地使用者">
                <el-input v-model="ywDanganForm.landuser"></el-input>
            </el-form-item>
            <el-form-item label="分类号">
                <el-select v-model="ywDanganForm.flh" >
                    <el-option v-for="flh in options.flhOptions" :key="flh.flh" :label="flh.flh"
                               :value="flh.value"></el-option>
                </el-select>
            </el-form-item>
            <el-form-item label="土地证号">
                <el-input v-model="ywDanganForm.zh"></el-input>
            </el-form-item>
            <el-form-item label="批准文号">
                <el-input v-model="ywDanganForm.pzwh"></el-input>
            </el-form-item>
            <el-form-item label="土地坐落">
                <el-input v-model="ywDanganForm.position"></el-input>
            </el-form-item>
            <el-form-item label="土地用途">
                <el-input v-model="ywDanganForm.tdyt"></el-input>
            </el-form-item>
            <el-form-item label="地号">
                <el-input v-model="ywDanganForm.dh"></el-input>
            </el-form-item>
            <el-form-item label="土号">
                <el-input v-model="ywDanganForm.th"></el-input>
            </el-form-item>
            <el-form-item label="权属性质">
                <el-input v-model="ywDanganForm.qsxz"></el-input>
            </el-form-item>
            <el-form-item label="全宗号">
                <el-input v-model="ywDanganForm.qzh"></el-input>
            </el-form-item>
            <el-form-item label="案卷号">
                <el-input v-model="ywDanganForm.ajh"></el-input>
            </el-form-item>
            <el-form-item label="年度">
                <el-date-picker
                        v-model="ywDanganForm.nd"
                        type="year"
                        value-format="yyyy"
                        placeholder="选择年">
                </el-date-picker>
            </el-form-item>
            <el-form-item label="土地面积">
                <el-input v-model="ywDanganForm.tdmj"></el-input>
            </el-form-item>
            <el-form-item label="地类">
                <el-input v-model="ywDanganForm.dl"></el-input>
            </el-form-item>
            <el-form-item label="土地等级">
                <el-select  v-model="ywDanganForm.tddj" placeholder="">
                    <el-option label="一级" value="一级">一级</el-option>
                    <el-option label="二级" value="二级">二级</el-option>
                    <el-option label="三级" value="三级">三级</el-option>
                    <el-option label="四级" value="四级">四级</el-option>
                    <el-option label="五级" value="五级">五级</el-option>
                </el-select>
            </el-form-item>
            <el-form-item label="件数">
                <el-input type="number" v-model="ywDanganForm.js"></el-input>
            </el-form-item>
            <el-form-item label="页数">
                <el-input type="number" v-model="ywDanganForm.ys"></el-input>
            </el-form-item>
            <el-form-item label="保管期限：">
                <el-select  v-model="ywDanganForm.bgqx" placeholder="">
                    <el-option label="10年" value="10年">10年</el-option>
                    <el-option label="30年" value="30年">30年</el-option>
                    <el-option label="长期" value="长期">长期</el-option>
                    <el-option label="短期" value="短期">短期</el-option>
                    <el-option label="永久" value="永久">永久</el-option>
                </el-select>
            </el-form-item>
        </el-form>
        <span slot="footer" class="dialog-footer">
            <el-button @click="addYwDanganDialogVisible = false">取 消</el-button>
            <el-button type="primary" @click="addYwDangan">确 定</el-button>
        </span>

    </el-dialog>
    <el-dialog
        :visible.sync="locationBindVisible"
        fullscreen=true
        width="100%"
        height="100%"
        center
        title="定位绑定"
    >
        <el-row style="height:100%;">
            <el-col :span="6" style="height: 100%;">
                <div class="row pdf-menu-title"
                     style="line-height:1.7 ;height:5%;margin-left:0px;font-size:18px;font-weight: bold;text-indent: 20px;">
                    档案基本信息
                </div>
                <div class="" style="height: 90%;width: 100% ;overflow-y: scroll;">
                    <div class="pdf-info"> 用地单位：{{dangan.landuser}}</div>
                    <div class="pdf-info">土地坐落： {{dangan.position}}</div>
                    <div class="pdf-info" style="width: 100%">
                        证 号：{{dangan.zh}}
                    </div>
                    <div class="pdf-info">批准文号： {{dangan.pzwh}}</div>
                    <div class="pdf-info"> 所在地： {{dangan.szd}}
                    </div>
                    <div class="pdf-info"> 图号： {{dangan.th}}
                    </div>
                    <div class="pdf-info"> 地号： {{dangan.dh}}
                    </div>
                    <div class="pdf-info"> 地类： {{dangan.dl}}
                    </div>
                    <div class="pdf-info"> 土地等级： {{dangan.tddj}}
                    </div>
                    <div class="pdf-info"> 权属性质： {{dangan.qsxz}}
                    </div>
                    <div class="pdf-info"> 发证日期： {{dangan.fzrq}}
                    </div>

                    <div class="pdf-info"> 件 &nbsp; &nbsp;&nbsp; &nbsp; 号： &nbsp;{{dangan.js}}
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 页&nbsp; &nbsp;&nbsp; &nbsp;数：{{dangan.ys}}
                    </div>
                    <div class="pdf-info"> 密&nbsp; &nbsp;&nbsp; &nbsp; 级： &nbsp;{{dangan.mj}}
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 保 管 期 限：{{dangan.bgqx}}
                    </div>
                    <div class="pdf-info"> 全&nbsp;宗 &nbsp; 号： &nbsp;{{dangan.qzh}}
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 目 &nbsp;录 &nbsp; 号：{{dangan.mlh}}
                    </div>
                    <div class="pdf-info"> 分&nbsp;类 &nbsp; 号： &nbsp;{{dangan.flh}}
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 案 &nbsp;卷 &nbsp; 号：{{dangan.ajh}}
                    </div>
                </div>
            </el-col>
            <el-col :span="18" style="height:100%">
                <div  @click="hidePdfLeftInfo" class="hand" style="height: 100%;
                float: left;cursor: pointer;width: 2%;">
                </div>
                <div style="height: 100%;width: 98%;float: left">
                    <el-form ref="tbpxmForm" :inline="true"
                             label-position="left"
                             style="width:80%;"
                             size="small" :model="form" label-width="120px">
                        <el-form-item  class="mb_5" label="项目名称" label-width="90px">
                            <el-input v-model="tbpxmForm.xmmc" clearable></el-input>
                        </el-form-item>
                        <el-form-item label="项目编号">
                            <el-input v-model="tbpxmForm.xmbh" clearable></el-input>
                        </el-form-item>
                        <el-form-item   label="批准文号">
                            <el-input v-model="tbpxmForm.pzwh" clearable></el-input>
                        </el-form-item>
                        <el-form-item  label="批复文号" label-width="50px;">
                            <el-input v-model="tbpxmForm.pfwh" clearable></el-input>
                        </el-form-item>
                        <el-form-item>
                            <el-button type="primary" @click="searchTbpxm">查询</el-button>
                        </el-form-item>
                    </el-form>
                    <div style="height: 40px;display: block;padding-bottom: 15px;">
                        <el-pagination
                                style="margin-bottom: 10px;"
                                background
                                layout="prev, pager, next,total"
                                @current-change="jsydBindPageChange"
                                @prev-click="jsydBindPageChange"
                                @next-click="jsydBindPageChange"
                                :current-page="tbpxmPage.currPage"
                                prev-text="上一页"
                                next-text="下一页"
                                :total="tbpxmPage.totalCount">
                        </el-pagination>
                    </div>
                    <el-row>
                        <el-table
                                :data="tbpxmTableData"
                                stripe
                                border
                                size="mini"
                                max-height="400px"
                                style="width: 100%;box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);"
                        >
                            <el-table-column
                                    prop="xh"
                                    align="center"
                                    header-align="center"
                                    label="序号"
                                    width="120">
                            </el-table-column>
                            <el-table-column
                                    align="left"
                                    header-align="center"
                                    prop="xmMc"
                                    width="240"
                                    label="项目名称">
                            </el-table-column>
                            <el-table-column
                                    align="left"
                                    header-align="center"
                                    prop="xmBh"
                                    width="140"
                                    label="项目编号">
                            </el-table-column>
                            <el-table-column
                                    prop="pfWh"
                                    label="批复文号"
                                    width="160">
                            </el-table-column>
                            <el-table-column
                                    align="left"
                                    header-align="center"
                                    prop="sPzWh"
                                    label="批准文号"
                                    >
                            </el-table-column>
                            <el-table-column
                                    align="center"
                                    header-align="center"
                                    prop="zbNd"
                                    width="100"
                                    label="年度">
                            </el-table-column>
                            <el-table-column
                                    align="left"
                                    header-align="center"
                                    width="180"
                                    label="操作">
                                <template slot-scope="scope">
                                    <el-button @click="bindJsydLocation(scope.row)" type="default" size="small">绑定</el-button>
                                    <el-button @click="showYwPdf(scope.row)" type="primary" size="small">查看</el-button>
                                </template>
                            </el-table-column>
                        </el-table>
                    </el-row>
                </div>
            </el-col>
        </el-row>

        <span slot="footer" class="dialog-footer">
            <el-button type="primary" @click="locationBindVisible = false">返回</el-button>
          </span>
    </el-dialog>
</div>


</body>
<style type="text/css">
    .modle_nomh {
        background-color: #ffffff;
        border: solid 1px #ccc;
        border-radius: 5px;
    }
</style>
<script type="text/javascript">
    const make_cols = refstr => Array(XLSX.utils.decode_range(refstr).e.c + 1).fill(0).map((x,i) => ({name:XLSX.utils.encode_col(i), key:i}));

    const _SheetJSFT = [
        "xlsx", "xlsb", "xlsm", "xls", "xml", "csv", "txt", "ods", "fods", "uos", "sylk", "dif", "dbf", "prn", "qpw", "123", "wb*", "wq*", "html", "htm"
    ].map(function(x) { return "." + x; }).join(",");
    const http = axios.create({

        baseURL: getUrl(),
        timeout: 100000,
        withCredentials: false, // 是否允许带cookie这些
        // headers: {'Content-Type': 'application/json'}
    });
    var vm = new Vue({
        el: '#app',
        data: {
            gdForm: {
                js: 1,//件号
                ys: 1,
                bgqx: "10年",//保管期限
                nd: '2019',//年度
                wh: "",//文号
                swh: "",//收文号
                bt: "",//文件标题
                flh: "A",
                wh: "",//文号
                bt: "",//标题
                rq: "",//文档日期
                zrr: "",//责任人
                qzh: "0478",//全宗号
                jnmlqx: "1",//文件权限
                inmlqx: "1",//案卷权限
                wsDanganStatus: "danger未归档",//文书档案状态，danger未归档，success已经归档
                upLoadType: 1,//1是ftp，2是本地上传
                serverXh: 0,//Oa服务器的序号
                isGD: false,
                vrecid: 0,//oa服务器文书档案的主键
                fileName:''
            },
            form: {
                js: "",//件号
                bgqx: "",//保管期限
                nd: "",//年度
                wh: "",//文号
                bt: "",//文件标题
                flh: "A",
            },
            ywForm: {
                c:{
                    zh: "",//土地证号
                    th: "",//图号
                    dh: "",//地号
                },
                e:{
                    pzwh: "",//批准证号
                    bt: "",//标题项目名称
                },
                ajh: "",//案卷号
                szd: "",//所在地
                landuser: "",//土地使用者
                position: "",//土地坐落
                flh: "C",//分类号
                sFlh:"C",//子分类号
            },
            pdfDialogVisible: false,//查看pdf
            ywPdfDialogVisible:false,
            editWsDialogVisible: false,//文书档案编辑
            tableData: [],
            page: {
                totalCount: 0,
                pageSize: 10,
                totalPage: 1,
                currPage: 1,
            },
            bgqxOptions: [],//保管期限选择项
            dangan: {
                filePath: "",//档案的文件全路径
                jnmlbh: 0,
            },//显示pdf对应的文书档案的详细属性
            years: [],
            szd: [],//所在地
            showPdfNbxh: '',
            multipleSelection: [],
            wsGd: true,
            wsEdit: false,
            ywEdit:false,
            ywAdd:false,
            upload: {
                // 地址
                url: getUrl()+'/file/upload',
                // token
                cookies: true,
                // 上传参数
                params: {},
                uuid: "",//文件上传返回的uuid
                filePath: '',
                reUpLoadJnml: false,
            },
            daJnmlData: [],//文书档案卷内目录
            pdfUrl: "",//pdf的路径
            ywPdfUrl:"",
            loginForm:{
                loginVisible:false,//登录窗口显示
                username:"",
                password:"",
                dialog:false,
                rules:{
                    username:[{required: true,message:'请输入登录名', trigger: 'blur'}],
                    password: [{required: true,message:'请输入密码', trigger: 'blur'}]
                }
            },
            pwdForm:{
                resetPasswordVisible:false,
                oldPassword:'',
                newPassword:'',
                rules:{
                    oldPassword:[{required: true,message:'请输入原密码，初始密码123456', trigger: 'blur'}],
                    newPassword: [{required: true,message:'请输入新密码', trigger: 'blur'}]
                },
                showCancel:true,
            },
            cascaderProps:{
                value:'value',
                label:'label',
                children:'children',
                checkStrictly: true,
            },
            options: {
                flhOptions: [{flh:"C", value:"C"},{flh:"D", value:"D"},{flh:"E", value:"E"}],
                flhDetailOptions:[
                    {label:"C", value:"C",children:[
                            {label: "C2:土地调查、利用现状、变更调查材料", value: "C2"},
                            {label: "C3:城镇地籍调查、农村村庄地籍调查", value: "C3"},
                            {label: "C4:土地登记", value: "C4"},
                            {label: "C5:土地分等定级", value: "C5"}
                        ]},
                    {label:"D", value:"D"},
                    {label:"E", value:"E",children:[
                        {label:"E2:国家建设分批次用地审批材料 ",value:"E2"},
                            {label:"E3:国家建设用地具体项目用地审批材料 ",value:"E3"},
                            {label:"E4:个人建房用地审批材料 ",value:"E4"},
                            {label:"E5:土地租凭、抵押、转让审批材料 ", value:"E5"},
                            {label:"E6:土地使用权出让审批材料 ", value:"E6"},
                            {label:"E7:土地储备", value:"E7"},
                            {label:"E8:征地拆迁 ", value:"E8"}]}
                ],
                szdOptions: [],
                cFlhOptions: [{flh: "C2:土地调查、利用现状、变更调查材料", value: "C2"},
                    {flh: "C3:城镇地籍调查、农村村庄地籍调查", value: "C3"}, {flh: "C4:土地登记", value: "C4"}, {
                        flh: "C5:土地分等定级",
                        value: "C5"
                    }],
                eFlhOptions:[{flh:"E2:国家建设分批次用地审批材料 ",value:"E2"},
                    {flh:"E3:国家建设用地具体项目用地审批材料 ",value:"E3"},{flh:"E4:个人建房用地审批材料 ",value:"E4"},{flh:"E5:土地租凭、抵押、转让审批材料 ",
                        value:"E5"},{flh:"E6:土地使用权出让审批材料 ",
                        value:"E6"},{flh:"E7:土地储备",
                        value:"E7"},{flh:"E8:征地拆迁 ",
                        value:"E8"}],
            },
            SheetJSFT: _SheetJSFT,
            exportExcelData:[],
            username:'',
            ywTableData:[],//业务档案
            ywPage: {
                totalCount: 0,
                pageSize: 10,
                totalPage: 1,
                currPage: 1,
            },
            activeJnmlbh: 0,
            eColumn:false,
            columnLable:{
                landuser: "土地使用者",//用地单位
            },
            editJnml:{},
            jnmlUploadPath:'',//卷内目录临时上传文件路径
            jnmlDialogVisible:false,
            addYwDanganDialogVisible:false,
            ywDanganForm:{ //新增的业务档案
                landuser:'',
                zh:'',
                pzwh:'',
                position:'',
                szd:'',
                pzjg:'',
                tdyt:'',
                dh:'',
                qsxz:'',
                th:'',
                dl:'',
                tddj:'四级',
                fzrq:'',
                js:1,
                ys:0,
                mj:'',
                bgqx:'长期',
                qzh:'',
                mlh:'',
                flh:'C',
                pflh:'C',
                ajh:'',
                nd:'',
                tdmj:'',
            },
            locationBindVisible:false,
            tbpxmTableData:[],
            tbpxmPage: {
                totalCount: 0,
                pageSize: 10,
                totalPage: 1,
                currPage: 1,
            },
            bindJsyd:{},//带绑定的建设用地档案属性
            tbpxmForm:{
                xmbh:'',//项目编号
                pfwh:'',//
                pzwh:'',//市批准文号
                xmmc:'',
                nd:''
            }
        },
        mounted() {
            // this.isLogin()
            this.username=window.localStorage.getItem("username")
            let date = new Date()
            this.loadDangan(1);
            this.loadYwDangan();
            this.loadBgqx();
            this.initYear();
            this.gdForm.nd = date.getFullYear()
            this.getJs()
            // this.loadFlh()
            this.loadSzd()
            var now=new Date()
            console.info(now.getFullYear())
            this.ywDanganForm.nd=now.getFullYear()+"-01-01";
        },
        methods: {
            selectYwDanganFlhChange(flh){
                console.info(flh)
                if(flh.length>1){
                    this.ywDanganForm.pflh=flh[0]
                    this.ywDanganForm.flh=flh[1]
                }else{
                    this.ywDanganForm.flh=flh[0]
                    this.ywDanganForm.pflh=flh[0]
                }
            },
            searchTbpxm(){
                let params=new URLSearchParams();
                params.append("page", this.tbpxmPage.currPage)
                params.append("xmmc",this.tbpxmForm.xmmc)
                params.append("pzwh",this.tbpxmForm.pzwh)
                params.append("pfwh",this.tbpxmForm.pfwh)
                params.append("xmbh",this.tbpxmForm.xmbh)
                http.post('/tbpxm/list', params).then(function (resp) {
                    console.info(resp)
                    if (resp.data.code == 0) {
                        this.tbpxmTableData = resp.data.page.list
                        this.tbpxmPage.totalCount = resp.data.page.totalCount
                        this.tbpxmPage.pageSize = resp.data.page.pageSize
                        this.tbpxmPage.totalPage = resp.data.page.totalPage
                        this.tbpxmPage.currPage = resp.data.page.currPage
                        for (let i = 0; i < this.tbpxmTableData.length; i++) {
                            this.tbpxmTableData[i].xh = this.tbpxmPage.pageSize * (this.tbpxmPage.currPage - 1) + i + 1;
                        }
                    } else {
                        this.$message.error(resp.data.msg)
                    }
                }.bind(this)).catch(function (err) {
                    console.error(err)
                });
            },
            jsydBindPageChange(page) {//翻页
                this.tbpxmPage.currPage = page
                this.searchTbpxm()
            },
            bindJsydVisibleClick(row){
                this.dangan=row
                this.locationBindVisible=true
                this.searchTbpxm()
            },
            bindJsydLocation(row){
                let params = new URLSearchParams();
                params.append("nbxh", this.dangan.nbxh)
                params.append("xmguid", row.xmGuid)
                http.post('/dadjgll/update', params).then(function (resp) {
                    console.info(resp)
                    if (resp.data.code == 0) {

                        this.$message({
                            message: '绑定定位成功',
                            type: 'success',
                            offset: 100
                        });
                    } else {
                        this.$message({
                            message: '保存失败:' + resp.data.msg,
                            type: 'error',
                            offset: 100
                        });
                    }
                }.bind(this)).catch(function (err) {
                    console.error(err)
                });
            },
            deleteYwDangan(row,index){
                this.$confirm('此操作将永久删除该业务档案, 是否继续?', '提示', {
                    confirmButtonText: '确定',
                    cancelButtonText: '取消',
                    type: 'warning'
                }).then(() => {
                    let params = new URLSearchParams();
                    let nbxhs=new Array()
                    nbxhs.push(row.nbxh)
                    params.append("nbxhs", nbxhs)
                    http.post('/dadjgll/delete', params).then(function (resp) {
                        console.info(resp)
                        if (resp.data.code == 0) {
                            this.$message({
                                message: '删除成功',
                                type: 'success',
                                offset: 100
                            });
                            this.ywTableData.splice(index,1)
                        } else {
                            this.$message({
                                message: '删除失败:',
                                type: 'error',
                                offset: 100
                            });
                        }
                    }.bind(this)).catch(function (err) {
                        console.error(err)
                    });
                }).catch(() => {
                    this.$message({
                        type: 'info',
                        message: '已取消删除'
                    });
                });
            },
            addYwDangan(){
                let params = new URLSearchParams();
                params.append("nbxh", this.ywDanganForm.nbxh)
                params.append("landuser", this.ywDanganForm.landuser)
                params.append("zh", this.ywDanganForm.zh)
                params.append("pzwh", this.ywDanganForm.pzwh)
                params.append("position", this.ywDanganForm.position)
                params.append("szd", '市局')
                params.append("tdyt", this.ywDanganForm.tdyt)
                params.append("dh", this.ywDanganForm.dh)
                params.append("th", this.ywDanganForm.th)
                params.append("dl", this.ywDanganForm.dl)
                params.append("qsxz", this.ywDanganForm.qsxz)
                params.append("tddj", this.ywDanganForm.tddj)
                params.append("js", this.ywDanganForm.js)
                params.append("ys", this.ywDanganForm.ys)
                params.append("mlh", this.ywDanganForm.mlh)
                params.append("flh", this.ywDanganForm.flh)
                params.append("ajh", this.ywDanganForm.ajh)
                params.append("qzh", this.ywDanganForm.qzh)
                params.append("nd", this.ywDanganForm.nd)
                params.append("pflh",this.ywDanganForm.pflh)
                http.post('/dadjgll/save', params).then(function (resp) {
                    console.info(resp)
                    if (resp.data.code == 0) {
                        this.$message({
                            message: '保存业务档案成功',
                            type: 'success',
                            offset: 100
                        });
                        // this.ywTableData.splice(0,0,resp.data.data)
                    } else {
                        this.$message({
                            message: '保存失败:' + resp.data.msg,
                            type: 'error',
                            offset: 100
                        });
                    }
                }.bind(this)).catch(function (err) {
                    console.error(err)
                });
            },
            saveYwDangan(ywDangan){
                let params = new URLSearchParams();
                params.append("nbxh", this.dangan.nbxh)
                params.append("landuser", this.dangan.landuser)
                params.append("zh", this.dangan.zh)
                params.append("pzwh", this.dangan.pzwh)
                params.append("position", this.dangan.position)
                params.append("szd", this.dangan.szd)
                params.append("tdyt", this.dangan.tdyt)
                params.append("dh", this.dangan.dh)
                params.append("th", this.dangan.th)
                params.append("js", this.dangan.js)
                params.append("ys", this.dangan.ys)
                params.append("mlh", this.dangan.mlh)
                params.append("flh", this.dangan.flh)
                params.append("ajh", this.dangan.ajh)
                params.append("qzh", this.dangan.qzh)
                http.post('/dadjgll/update', params).then(function (resp) {
                    console.info(resp)
                    if (resp.data.code == 0) {

                        this.$message({
                            message: '保存业务档案成功',
                            type: 'success',
                            offset: 100
                        });
                    } else {
                        this.$message({
                            message: '保存失败:' + resp.data.msg,
                            type: 'error',
                            offset: 100
                        });
                    }
                }.bind(this)).catch(function (err) {
                    console.error(err)
                });
            },
            editYwJnmlDialog(jnml){
                this.jnmlDialogVisible=true
                this.editJnml=jnml
            },
            deleteYwJnmlDialog(jnml,index){
                this.$confirm('此操作将永久删除该卷内目录, 是否继续?', '提示', {
                    confirmButtonText: '确定',
                    cancelButtonText: '取消',
                    type: 'warning'
                }).then(() => {
                    let params = new URLSearchParams();
                    params.append("jnmlbh", jnml.jnmlbh)
                    http.post('/dajnmlb/delete', params).then(function (resp) {
                        console.info(resp)
                        if (resp.data.code == 0) {
                            this.$message({
                                message: '删除成功',
                                type: 'success',
                                offset: 100
                            });
                            this.daJnmlData.splice(index,1)
                        } else {
                            this.$message({
                                message: '删除失败:',
                                type: 'error',
                                offset: 100
                            });
                        }
                    }.bind(this)).catch(function (err) {
                        console.error(err)
                    });
                    this.$message({
                        type: 'success',
                        message: '删除成功!'
                    });
                }).catch(() => {
                    this.$message({
                        type: 'info',
                        message: '已取消删除'
                    });
                });
            },
            editYwJnml(){
                var mlmc=this.editJnml.mlmc
                    let params=new URLSearchParams()
                    params.append("jnmlbh",this.editJnml.jnmlbh)
                    params.append("mlmc",this.editJnml.mlmc)
                let loading = this.$loading({
                        lock: true,
                        text: 'Loading',
                        spinner: 'el-icon-loading',
                        background: 'rgba(0, 0, 0, 0.7)'
                    });
                    http.post('/dajnmlb/update', params).then(function (resp) {
                        console.info(resp)
                        loading.close()
                        if (resp.data.code == 0) {
                            this.$message({
                                message: '保存卷内目录名称成功',
                                type: 'success',
                                offset: 100
                            });
                            this.jnmlDialogVisible=false
                        } else {
                            this.$message({
                                message: '保存失败:' + resp.data.msg,
                                type: 'error',
                                offset: 100
                            });
                        }
                    }.bind(this)).catch(function (err) {
                        console.error(err)
                    });
            },
            uploadJnmlFile(){
                if(!this.refs.jnmlFileUpload.uploadFiles.length){
                    this.$message.error("请选择要上传的文件")
                }else{
                    this.$refs.jnmlFileUpload.submit()
                }
            },
            ywJnmlFileUploadSuccess:function(response,file,fileList){
                console.info(response)
                if (response.code == 0) {
                    this.upload.filePath = response.filePath
                    this.upload.uuid = response.uuid
                    this.dangan.filePath = response.filePath
                    this.$message({
                        message: '上传成功',
                        type: 'success',
                        offset: 100
                    })
                    var params=new URLSearchParams();
                    params.append("jnmlbh",this.editJnml.jnmlbh);
                    params.append("nbxh",this.editJnml.nbxh);
                    params.append("uploadJnmlFilePath",response.filePath);
                    http.post('/dajnmlb/saveJnmlFile',params).then(function(resp){
                        console.info(resp)
                    }.bind(this)).catch(function (err) {
                        console.error(err)
                    })
                }
            },
            addYwJnml(nbxh){

                this.$prompt('输入名称', '卷内目录名称', {
                    confirmButtonText: '保存',
                    cancelButtonText: '取消',
                }).then(({ value }) => {
                    let params=new URLSearchParams()
                    params.append("nbxh",nbxh)
                    params.append("mlmc",value)
                    if(this.daJnmlData.length>0){
                        let jnml=this.daJnmlData[0]
                        params.append("mlqx",jnml.mlqx)
                        params.append("serverxh",jnml.serverxh)
                    }
                    http.post('/dajnmlb/save', params).then(function (resp) {
                        console.info(resp)
                        if (resp.data.code == 0) {
                            this.$message({
                                message: '新增卷内目录成功',
                                type: 'success',
                                offset: 100
                            });
                            this.daJnmlData.splice(this.daJnmlData.length,0,resp.data.data)
                        } else {
                            this.$message({
                                message: '新增失败:' + resp.data.msg,
                                type: 'error',
                                offset: 100
                            });
                        }
                    }.bind(this)).catch(function (err) {
                        console.error(err)
                    });
                    //todo   保存卷内目录
                    this.$message({
                        type: 'success',
                        message: '你的邮箱是: ' + value
                    });
                }).catch(() => {
                    this.$message({
                        type: 'info',
                        message: '取消输入'
                    });
                });
            },
            flhChange(value){
                if(value=='E'){
                    this.eColumn=true
                }else{
                    this.eColumn=false
                }
                this.ywForm.flh=value
                this.ywForm.sFlh=value
                this.ywDanganForm.flh=value
            },
            hidePdfLeftInfo() {
                //todo 隐藏pdf左侧详细内容
            },
            printTable(){
                if(this.multipleSelection.length>0){
                    $("#exportTable").prop("hidden", false);
                    $("#exportTable").jqprint();
                    $("#exportTable").prop("hidden", true);
                }else{
                    this.$message.info("您没有选中任何数据")
                }
            },
            exportExcel(){
                if(this.multipleSelection.length>0){
                    $("#exportTable").prop("hidden", false);
                    $("#exportTable").tableExport({type: 'excel', escape: 'false'});
                    $("#exportTable").prop("hidden", true);
                }else{
                    this.$message.info("您没有选中任何数据")
                }
            },
            loadHtml(url,flh){
                parent.location.href=url
                this.form.flh=flh
            },
            guiDang() {
                if (this.gdForm.isGD) {
                    this.$message.warning("该文档已经归档，请不要重复归档")
                    return;
                }
                let params = new URLSearchParams();
                params.append("js", this.gdForm.js)
                params.append("bt", this.gdForm.bt)
                params.append("bgqx", this.gdForm.bgqx)
                params.append("nd", this.gdForm.nd)
                params.append("wh", this.gdForm.wh)
                params.append("qzh", this.gdForm.qzh)
                params.append("flh", this.gdForm.flh)
                params.append("pflh", this.gdForm.flh)
                params.append("ys", this.gdForm.ys)
                params.append("zrr", this.gdForm.zrr)
                params.append("rq", this.gdForm.rq)
                params.append("filePath",  this.upload.filePath)
                params.append("type", this.gdForm.upLoadType)
                if(this.gdForm.upLoadType==1){
                    params.append("fileName",this.gdForm.fileName)
                }
                params.append("mlqx", this.gdForm.jnmlqx)
                params.append("serverXh", this.gdForm.serverXh)
                params.append("vrecid", this.gdForm.vrecid)
                http.post('/daws/guiDang', params).then(function (resp) {
                    console.info(resp)
                    if (resp.data.code == 0) {
                        this.getJs()
                        this.$message({
                            message: '归档成功',
                            type: 'success',
                            offset: 100
                        });
                        this.gdForm.bt=""
                        this.gdForm.wh=""
                        this.gdForm.swh=""
                    } else {
                        this.$message({
                            message: '归档失败:' + resp.data.msg,
                            type: 'error',
                            offset: 100
                        });
                    }
                }.bind(this)).catch(function (err) {
                    console.error(err)
                });
            },
            search() {
                this.page.page = 1
                this.loadDangan()
            },
            ywSearch(){
                this.ywPage.page = 1
                this.loadYwDangan()
            },
            searchOaWs() {
                let params = new URLSearchParams();

                if(this.gdForm.swh){
                    params.append("swbh", this.gdForm.swh)
                }
                if(this.gdForm.bt){
                    params.append("bt", this.gdForm.bt)
                }
                if(this.gdForm.wh){
                    params.append("wh", this.gdForm.wh)
                }
                params.append("nd", this.gdForm.nd)
                http.post('/daOaWs/list', params).then(function (resp) {
                    console.log("搜索oa文书档案结果")
                    console.log(resp)
                    if (resp.data.code == 0) {
                        let oaWs
                        if (resp.data.page.totalCount > 0) {
                            oaWs = resp.data.page.list[0]
                            this.$message.success("搜索成功")
                            this.gdForm.swh = oaWs.vswbh
                            this.gdForm.wh = oaWs.vlwbh
                            this.gdForm.rq = oaWs.vlastdate
                            this.gdForm.nd = oaWs.nd
                            this.gdForm.filePath = oaWs.lj
                            this.upload.filePath=oaWs.lj
                            // this.gdForm.bgqx = oaWs.bgqx
                            this.gdForm.bt = oaWs.vlwbt
                            this.gdForm.serverXh = oaWs.serverxh
                            this.gdForm.vrecid = oaWs.vrecid
                            this.gdForm.zrr=oaWs.vlwdw
                            this.gdForm.fileName=oaWs.vwjnr
                            this.isGuiDang(oaWs.vrecid)
                        } else {
                            this.$message.info("没有搜索到对应的数据")
                        }

                    }
                }.bind(this)).catch(function (err) {
                    console.error(err)
                });
            },
            loadDangan() {
                let params = new URLSearchParams();

                params.append("js", this.form.js)
                params.append("bt", this.form.bt)
                params.append("bgqx", this.form.bgqx)
                params.append("nd", this.form.nd)
                params.append("wh", this.form.wh)
                params.append("flh", this.form.flh)
                params.append("jnmlqx", this.page.jnmlqx)
                params.append("page", this.page.currPage)
                params.append("limit",this.page.pageSize)
                http.post('/daws/list', params).then(function (resp) {
                    this.tableData = resp.data.page.list
                    this.page.totalCount = resp.data.page.totalCount
                    this.page.pageSize = resp.data.page.pageSize
                    this.page.totalPage = resp.data.page.totalPage
                    this.page.currPage = resp.data.page.currPage
                    for (let i = 0; i < this.tableData.length; i++) {
                        this.tableData[i].xh = this.page.pageSize * (this.page.currPage - 1) + i + 1;
                        if(this.tableData[i].bgqx=="永久"){
                            this.tableData[i].dhbgqx="Y";
                        }else if(this.tableData[i].bgqx=="10年"){
                            this.tableData[i].dhbgqx="D10"
                        }else if(this.tableData[i].bgqx=="30年"){
                            this.tableData[i].dhbgqx="D30"
                        }else if(this.tableData[i].bgqx="长期"){
                            this.tableData[i].dhbgqx="D30"
                        }else if(this.tableData[i].bgqx="短期"){
                            this.tableData[i].dhbgqx="D10"
                        }else{
                            this.tableData[i].dhbgqx="Y"
                        }
                        this.tableData[i].bcjs=PrefixZero(this.tableData[i].js,4);
                        if(this.tableData[i].rq){
                            this.tableData[i].fmtrq=dateFormat("YYYYmmdd",new Date(this.tableData[i].rq))
                        }else{
                            this.tableData[i].fmtrq=""
                        }
                    }
                }.bind(this)).catch(function (err) {
                    console.error(err)
                });
            },
            loadYwDangan(){
                let params = new URLSearchParams();
                if(this.ywForm.flh=='C'){
                    params.append("zh", this.ywForm.c.zh)
                    params.append("th", this.ywForm.c.th)
                    params.append("dh", this.ywForm.c.dh)
                }
                if(this.ywForm.flh=='E'){
                    params.append("pzwh",this.ywForm.e.pzwh)
                }
                params.append("szd", this.ywForm.szd)
                params.append("landuser", this.ywForm.landuser)
                params.append("position", this.ywForm.position)
                params.append("flh", this.ywForm.flh)
                params.append("sFlh", this.ywForm.sFlh)
                params.append("ajh", this.ywForm.ajh)
                params.append("page", this.ywPage.currPage)
                http.post('/dadjgll/list', params).then(function (resp) {
                    console.log(resp)
                    if (resp.data.code == 0) {
                        this.ywTableData = resp.data.page.list
                        this.ywPage.totalCount = resp.data.page.totalCount
                        this.ywPage.pageSize = resp.data.page.pageSize
                        this.ywPage.totalPage = resp.data.page.totalPage
                        this.ywPage.currPage = resp.data.page.currPage
                        for (let i = 0; i < this.ywTableData.length; i++) {
                            this.ywTableData[i].xh = this.ywPage.pageSize * (this.ywPage.currPage - 1) + i + 1;
                        }
                    } else {
                        this.$message.error(resp.data.msg)
                    }

                }.bind(this)).catch(function (err) {
                    console.error(err)
                });
            },
            loadPdf(jnmlbh, type) {
                if (type == 1) {//根据uuid返回刚上传的文件
                    this.pdfUrl = getUrl()+"/statics/pdf/web/viewer.html?file=/danganSys/file/" + this.upload.uuid;
                    this.pdfDialogVisible = true
                } else if (type == 2) {//根据卷目录编号获取文件
                    this.pdfUrl = getUrl()+"/statics/pdf/web/viewer.html?file=/danganSys/file/download/" + jnmlbh;
                    document.getElementById('editPdfIframe').contentWindow.location.reload(true);
                } else if (type == 3) {
                    this.pdfUrl = getUrl()+"/statics/pdf/web/viewer.html?file=/danganSys/file/getOaWsFile/"
                        + this.gdForm.vrecid
                    this.pdfDialogVisible = true
                }
            },
            showPdf(row) {
                console.log(row)
                this.showPdfNbxh = row.nbxh
                this.dangan = row
                this.loadJnml(row.nbxh)
                this.pdfDialogVisible = true
            },
            showYwPdf(row) {
                console.log(row)
                this.showPdfNbxh = row.nbxh
                this.dangan = row
                this.loadYwJnml(row.nbxh)
                this.ywPdfDialogVisible = true
            },
            ywDanganPageChange(page) {//翻页
                this.ywPage.currPage = page
                this.loadYwDangan(page)
            },
            danganPageChange(page) {//翻页
                this.page.currPage = page
                this.loadDangan()
            },
            danganPageSizeChange(pageSize) {//翻页
                this.page.pageSize = pageSize
                this.loadDangan()
            },
            /**
             * 加载分类号
             */
            loadFlh() {
                let params = new URLSearchParams;
                let user = JSON.parse(window.localStorage.getItem("user"))
                params.append("userId", user.userId)
                http.post('/danganSys/dauserflh/list', params).then(function (resp) {
                    this.options.flhOptions = resp.data.page.list
                }.bind(this)).catch(function (err) {
                    console.error(err)
                })
            },
            loadSzd() {
                let params = new URLSearchParams;
                let user = JSON.parse(window.localStorage.getItem("user"))
                params.append("userId", user.userId)
                http.post('/danganSys/dauserlocation/list', params).then(function (resp) {
                    this.options.szdOptions = resp.data.page.list
                }.bind(this)).catch(function (err) {
                    console.error(err)
                })
            },
            loadBgqx() {
                let params = new URLSearchParams;
                // params.append("name","保管期限")
                http.post('/sys/dict/list?type=' + "保管期限").then(function (resp) {
                    // this.bgqxOptions=resp.data.page.list
                    this.bgqxOptions = resp.data.page.list
                }.bind(this)).catch(function (err) {
                    console.error(err)
                })
            },
            initYear() {
                var year = new Date().getFullYear();
                this.years[0] = year
                for (var i = 1; i < 30; i++) {
                    this.years[i] = year - i;
                }
            },
            handleSelectionChange(val) {
                this.multipleSelection = val;
            },
            editWsDangan(row) {
                this.editWsDialogVisible = true
                this.upload.reUpLoadJnml = false
                this.dangan = row
                this.loadJnml(row.nbxh)
            },
            uploadSuccess: function (response, file, fileList) {
                console.info(response)
                if (response.code == 0) {
                    this.upload.filePath = response.filePath
                    this.upload.uuid = response.uuid
                    this.dangan.filePath = response.filePath
                    if (this.wsEdit) {
                        this.upload.reUpLoadJnml = true
                    }
                }
            },
            getJs() {
                let params = new URLSearchParams();
                params.append("bgqx", this.gdForm.bgqx)
                params.append("nd", this.gdForm.nd)
                http.post("/daws/getJs", params).then(function (resp) {
                    this.gdForm.js = resp.data.js
                }.bind(this)).catch(function (err) {
                    console.error(err)
                })
            },
            /**
             * 判断文件是否归档
             */
            isGuiDang(vrecid) {
                let params = new URLSearchParams();

                params.append("vrecid", vrecid)
                params.append("flh", "A")
                http.post('/daws/list', params).then(function (resp) {
                    console.log("是否归档搜索结果")
                    console.log(resp)
                    this.tableData = resp.data.page.list
                    if (resp.data.page.totalCount > 0) {
                        this.gdForm.isGD = true
                    } else {
                        this.gdForm.isGD = false
                    }

                }.bind(this)).catch(function (err) {
                    console.error(err)
                });
            },
            /**
             * 加载卷内目录
             */
            loadJnml(nbxh) {
                let params = new URLSearchParams;
                params.append("nbxh", nbxh)
                console.info('加载卷内目录', nbxh)
                http.post('/dajnmlb/list', params).then(function (resp) {
                    if (resp.data.page.totalCount > 0) {
                        this.daJnmlData = resp.data.page.list
                        this.dangan.filePath = resp.data.page.list[0].ljmc
                        this.dangan.jnmlbh = resp.data.page.list[0].jnmlbh
                        this.$set(this.dangan, "hasJnml", true)
                        this.$set(this.dangan, "mlqx", resp.data.page.list[0].mlqx)
                        this.loadPdf(this.dangan.jnmlbh,2)
                    }else{
                        this.$set(this.dangan, "hasJnml", false)
                    }
                }.bind(this)).catch(function (err) {
                    console.error(err)
                })
            },
            loadYwJnml(nbxh) {
                let params = new URLSearchParams;
                params.append("nbxh", nbxh)
                console.info('加载卷内目录', nbxh)
                http.post('/dajnmlb/list', params).then(function (resp) {
                    this.daJnmlData = resp.data.page.list
                    if (this.daJnmlData.length > 0) {
                        // this.pdfUrl="/danganSys/statics/pdf/web/viewer.html?file=/danganSys/file/download/"+this.daJnmlData[0].jnmlbh
                        this.loadYwPdf(this.daJnmlData[0].jnmlbh)
                        this.$set(this.dangan, "hasJnml", true)
                    }else{
                        this.$set(this.dangan, "hasJnml", false)
                    }
                }.bind(this)).catch(function (err) {
                    console.error(err)
                })
            },
            loadYwPdf(jnmlbh) {
                this.ywPdfUrl = "/danganSys/statics/pdf/web/viewer.html?file=/danganSys/file/download/" + jnmlbh;
                document.getElementById('ywPdfIframe').contentWindow.location.reload(true);
                this.activeJnmlbh = jnmlbh
            },
            /**
             * 保存文书档案
             */
            saveWsDangan() {
                let params = new URLSearchParams();
                params.append("bgqx", this.dangan.bgqx)
                params.append("nd", this.dangan.nd)
                params.append("wh", this.dangan.wh)
                params.append("bt", this.dangan.bt)
                params.append("rq", this.dangan.rq)
                params.append("qzh", this.dangan.qzh)
                params.append("nbxh", this.dangan.nbxh)
                params.append("js", this.dangan.js)
                params.append("zrr", this.dangan.zrr)
                http.post("/daws/update", JSON.stringify(this.dangan),
                    {
                        headers: {'Content-Type': 'application/json'}
                    }
                ).then(function (resp) {
                    console.log(resp)
                    if(resp.data.code==0){
                        this.$message.success("保存成功")
                    }
                }.bind(this)).catch(function (err) {
                    console.error(err)
                })
                //当重新上传过卷内目录文件后，更新卷内目录的文件
                if (this.upload.reUpLoadJnml) {
                    let jnmlFileParams = new URLSearchParams()
                    jnmlFileParams.append("uuid", this.upload.uuid)
                    if(this.dangan.hasJnml===true){
                        jnmlFileParams.append("jnmlbh", this.dangan.jnmlbh)
                    }else if(this.dangan.hasJnml===false){
                        jnmlFileParams.append("nbxh", this.dangan.nbxh)
                        jnmlFileParams.append("bt", this.dangan.bt)
                    }
                    http.post("/dajnmlb/updateJnmlFile", jnmlFileParams
                    ).then(function (resp) {
                        if(resp.data.code==0){
                            this.$message.success("卷内目录文件更新成功")
                            this.upload.reUpLoadJnml=false
                        }
                        console.log(resp)
                    }.bind(this)).catch(function (err) {
                        console.error(err)
                    })
                }
            },
            deleteWsFile(row,index){
                this.$confirm('是否删除该文档?', '提示', {
                    confirmButtonText: '确定',
                    cancelButtonText: '取消',
                    type: 'warning'
                }).then(() => {
                    let params = new URLSearchParams()
                    params.append("nbxh",row.nbxh)
                    http.post('/daws/deleteByNbxh',params).then(function (resp) {
                        console.log(resp.data)
                        if (resp.data.code == 0) {
                            this.$message.success("删除成功")
                            this.tableData.splice(index,1)
                        } else {
                            this.$message.error("删除失败")
                        }
                    }.bind(this)).catch(function (err) {
                        console.error(err)
                    })
                }).catch(() => {
                    this.$message({
                        type: 'info',
                        message: '已取消删除'
                    });
                });

            },
            logout(){
                window.localStorage.clear()
                location.href="/danganSys/logout"
            },
            isLogin(){
                window.localStorage
                var login= window.localStorage.getItem("login")
                console.log("登录状态："+login)
                if(login&&login=="true"){
                    console.log("已登录")
                    this.loginForm.loginVisible=false
                }else{
                    this.$message.error("还未登录")
                    this.loginForm.loginVisible=true
                    console.log("还未登录")
                }
            },
            login(formName){
                this.$refs[formName].validate((valid) => {
                    if (valid) {
                        console.log("登录表单验证通过")
                        var data = "?username="+this.loginForm.username+"&password="+this.loginForm.password+"&captcha="+this.loginForm.password
                        http({ method: 'post',
                            url: 'sys/login'+data,
                            headers: {'Content-Type': 'application/json'}
                        }).then(function (result) {
                            if(result.data.code == 0){//登录成功
                                window.localStorage.setItem("login","true")
                                this.loginForm.loginVisible=false
                            }else{
                                window.localStorage.setItem("login","false")
                                this.$message.error(result.data.msg)
                            }
                        }.bind(this)).catch(function (err) {
                            console.error(err)
                        })
                        // http.post('sys/login',params, {
                        //     headers: {'Content-Type': 'application/json'}
                        // })
                    } else {
                        console.log('error submit!!');
                        return false;
                    }
                });
            },

            resetPassword(){
                this.$refs['pwdForm'].validate((valid) => {
                    if (valid) {
                        console.log("密码修改表单验证通过")
                        var data = "?password="+this.pwdForm.oldPassword+"&newPassword="+this.pwdForm.newPassword
                        http({ method: 'post',
                            url: 'sys/user/password'+data,
                            headers: {'Content-Type': 'application/json'}
                        }).then(function (result) {
                            if(result.data.code == 0){//修改密码成功
                                this.$message.success("密码修改成功")
                                this.pwdForm.resetPasswordVisible=false
                                this.pwdForm.oldPassword=''
                                this.pwdForm.newPassword=''
                            }else{
                                this.$message.error(result.data.msg)
                            }
                        }.bind(this)).catch(function (err) {
                            console.error(err)
                        })
                    } else {
                        console.log('error submit!!');
                        return false;
                    }
                });
            }
        }
    })
</script>

<style lang="scss" scoped>
    .el-dialog__header {
        padding: 15px;
        height: 5%;
    }

    .el-dialog__body {
        height: 88%;
        padding: 5px 15px 10px !important;;
    }

    .el-dialog__footer {
        height: 7%;
    }

    table {
        font-size: 15px;
    }
</style>
</html>



